<!doctype html>
<html>
<head>
<title>管理菜单添加</title>
    <?php $this->load->module('admin/index/page_header');?>
</head>
<body>

<div class="wrap">
    <div id="home_toptip"></div>
    <div class="nav">
        <ul>
            <li><a href="<?php echo site_url('admin/adminuser/index')?>">管理员管理</a></li> 
            <li><a href="<?php echo site_url('admin/adminuser/add')?>">添加管理员</a></li>
            <li class="current"><a href="javascript:void(0)">编辑管理员</a></li>
        </ul>
    </div>
    <div class="table_full">
	    <form class="formvalidate" action="<?php echo $form_post;?>" method="post">
	    <div class="h_a">编辑管理员</div>
	    <div class="table_full">
	        <table width="100%">
	            <col class="th" />
                <col/>
	            <tbody>
	            <tr>
	                <th>所属角色</th>
	                <td>
                        <?php if($disable){?>
                            <input name="Form[role_id]" type="hidden" value="<?php echo $row['role_id']?>" />
                            <?php foreach($role_list as $val):?>
                                <?php if($val['id']==$row['role_id']):?><?php echo $val['name'];?><?php endif;?>
                            <?php endforeach;?>(创始人)
                        <?php }else{?>
					    <select name="Form[role_id]" class="select rounded" style="font-family: 'Courier New', Courier, monospace;">
					    <?php if(!empty($role_list)):?>
					    <?php foreach($role_list as $val):?>
						<option<?php if($val['id']==$row['role_id']):?> selected="selected"<?php endif;?> value="<?php echo $val['id'];?>"><?php echo $val['name'];?></option>
						<?php endforeach;?>
						<?php endif;;?>
					    </select>
                        <?php }?>
                    </td>
	            </tr>
	            <tr>
	                <th>用户名</th>
	                <td>
                        <?php if($disable){?>
                            <?php echo $row['name'];?>
                        <?php }else{?>
                            <input type="text" value="<?php echo $row['name'];?>" name="Form[name]" class="input rounded" size="30" validate="{required:true,rangelength:[1,20],isNotMobile:true,isNotEmail:true,remote:'<?php echo $ajax_check_name;?>'}" />
                        <?php }?></td>
	            </tr>
	            <tr>
	                <th>密码</th>
	                <td><input id="u_password" type="password" name="Form[password]" class="input rounded" size="30" validate="{rangelength:[6,20],equalTo:'#u_password'}" /></td>
	            </tr>
	            <tr>
	                <th>重复密码</th>
	                <td><input type="password" name="confirm_password" class="input rounded" size="30" validate="{rangelength:[6,20],equalTo:'#u_password'}" /></td>
	            </tr>
                <tr>
	                <th>所属部门</th>
	                <td>
	                    <select name="Form[division_id]" class="select rounded" style="font-family: 'Courier New', Courier, monospace;">
                        <option value="-1">公司总部</option>
                            <?php echo $select_categorys;?>
                        </select>&nbsp;&nbsp;(如选择公司总部，表示拥有查看所有部门的业绩权限)
                    </td>
	            </tr>
<!--	            <tr>
	                <th>E-mail</th>
	                <td><input type="text" value="<?php /*echo $row['email'];*/?>" name="Form[email]" class="input rounded" size="30" validate="{required:true,email:true,remote:'<?php /*echo $ajax_check_email;*/?>'}" /></td>
	            </tr>-->
	            <tr>
                    <th>手机号码</th>
                    <td><input type="text" value="<?php echo $row['mobile'];?>" name="Form[mobile]" class="input rounded" size="30" validate="{required:true,isMobile:true,remote:'<?php echo $ajax_check_mobile;?>'}" /></td>
                </tr>
	            <tr>
	                <th>备注</th>
	                <td><textarea name="Form[remark]" rows="5" cols="47"><?php echo $row['remark'];?></textarea></td>
	            </tr>
	            <tr>
	                <th>状态</th>
	                <td>
	                    <label><input type="radio" value="1"<?php if($row['is_open']==1):?> checked="checked"<?php endif;?> name="Form[is_open]" />启用</label>
                        <label><input type="radio" value="0"<?php if($row['is_open']==0):?> checked="checked"<?php endif;?> name="Form[is_open]" />禁用</label>
                    </td>
	            </tr>
                <tr>
                    <th>是否可DIY</th>
                    <td>
                        <label><input type="radio" value="1"<?php if($row['is_diy']==1):?> checked="checked"<?php endif;?> name="Form[is_diy]" checked="checked" />启用</label>
                        <label><input type="radio" value="0"<?php if($row['is_diy']==0):?> checked="checked"<?php endif;?> name="Form[is_diy]" />禁用</label>
                    </td>
                </tr>
	            </tbody>
	        </table>
	    </div>
	    <div class="btn_wrap">
	        <div class="btn_wrap_pd">
	            <input type="hidden" name="id" value="<?php echo $row['id'];?>" />
	            <button type="submit" class="btn btn_submit J_ajax_submit_btn">提交</button>
	        </div>
	    </div>
	    </form>
    </div>
</div>
</body>
</html>